 import {createApi, fetchBaseQuery} from "@reduxjs/toolkit/dist/query/react"

 const studentApi = createApi({
    reducerPath:"studentApi",
    baseQuery:fetchBaseQuery({
        baseUrl:"http://localhost:1337/api"  
    }),
    endpoints(build){    
        return {
            getStudents:build.query({
                query(){
                    return "students";
                }
            })
        };
    }
 })


 export const {
    useGetstudentsQuery
 } = studentApi;

 export default studentApi